from django.urls import path
from .views import (
    CameraEntryListView, CameraEntryDetailView, CameraEntryCreateView,
    CameraEntryUpdateView, CategoryListView, CategoryDetailView, camera_delete,
    AccessoryListView, AccessoryDetailView, AccessoryCreateView,
    AccessoryUpdateView, AccessoryCategoryListView, AccessoryCategoryDetailView, accessory_delete,
    AboutView
)

app_name = 'encyclopedia'
urlpatterns = [
    # 相机相关URL
    path('', CameraEntryListView.as_view(), name='camera_list'),
    path('camera/<int:pk>/', CameraEntryDetailView.as_view(), name='camera_detail'),
    path('camera/add/', CameraEntryCreateView.as_view(), name='camera_add'),
    path('camera/<int:pk>/edit/', CameraEntryUpdateView.as_view(), name='camera_edit'),
    path('camera/<int:pk>/delete/', camera_delete, name='camera_delete'),
    
    # 分类相关URL
    path('categories/', CategoryListView.as_view(), name='category_list'),
    path('category/<int:pk>/', CategoryDetailView.as_view(), name='category_detail'),
    
    # 配件相关URL
    path('accessories/', AccessoryListView.as_view(), name='accessory_list'),
    path('accessory/<int:pk>/', AccessoryDetailView.as_view(), name='accessory_detail'),
    path('accessory/add/', AccessoryCreateView.as_view(), name='accessory_add'),
    path('accessory/<int:pk>/edit/', AccessoryUpdateView.as_view(), name='accessory_edit'),
    path('accessory/<int:pk>/delete/', accessory_delete, name='accessory_delete'),
    
    # 配件分类相关URL
    path('accessory-categories/', AccessoryCategoryListView.as_view(), name='accessory_category_list'),
    path('accessory-category/<int:pk>/', AccessoryCategoryDetailView.as_view(), name='accessory_category_detail'),
    
    # 其他页面
    path('about/', AboutView.as_view(), name='about'),
]